knitr::opts_knit$set(root.dir = '../../')

1 Overall Activation

source('scripts/my_r.R')
library(feather)
## Warning: package 'feather' was built under R version 3.3.2
library(ggplot2)
library(reshape2)
library(bsselectR)
info <- c('Type1', 'newseq.matchgc.Noonan', 'motif_activation')
pos <- load_and_melt('pattern/Type1/newseq.matchgc.Noonan/motif_activation/pattern_positive.feather')
neg <- load_and_melt('pattern/Type1/newseq.matchgc.Noonan/motif_activation/pattern_negative.feather')
ggplot(pos$table.melted) + geom_raster(aes(x = variable, y = id, fill = value)) + scale_fill_gradient2() + ggtitle('Activation per sequence (Positive)') + labs(x = 'motif', y = 'sequence')

ggplot(neg$table.melted) + geom_raster(aes(x = variable, y = id, fill = value)) + scale_fill_gradient2() + ggtitle('Activation per sequence (Negative)') + labs(x = 'motif', y = 'sequence')

2 Per Motif Activation

pvalues <- c()
motifs <- c()
for(i in colnames(pos$table)){
    if(i != 'id'){
        poss <- pos$table[[i]]
        negs <- neg$table[[i]]
        pvalues <- c(pvalues, wilcox.test(poss, negs)$p.value)
        motifs <- c(motifs, i)
    }
}
df <- data.frame(motif=motifs, p.value=pvalues)

2.1 Motif activation comparison (positive vs negative)

3 Show top 20 motifs

3.1 1 : Motif.185

1 : Motif.185

1 : Motif.185

3.2 2 : Motif.100

2 : Motif.100

2 : Motif.100

3.3 3 : Motif.59

3 : Motif.59

3 : Motif.59

3.4 4 : Motif.275

4 : Motif.275

4 : Motif.275

3.5 5 : Motif.291

5 : Motif.291

5 : Motif.291

3.6 6 : Motif.241

6 : Motif.241

6 : Motif.241

3.7 7 : Motif.78

7 : Motif.78

7 : Motif.78

3.8 8 : Motif.168

8 : Motif.168

8 : Motif.168

3.9 9 : Motif.193

9 : Motif.193

9 : Motif.193

3.10 10 : Motif.29

10 : Motif.29

10 : Motif.29

3.11 11 : Motif.46

11 : Motif.46

11 : Motif.46

3.12 12 : Motif.73

12 : Motif.73

12 : Motif.73

3.13 13 : Motif.106

13 : Motif.106

13 : Motif.106

3.14 14 : Motif.0

14 : Motif.0

14 : Motif.0

3.15 15 : Motif.143

15 : Motif.143

15 : Motif.143

3.16 16 : Motif.133

16 : Motif.133

16 : Motif.133

3.17 17 : Motif.222

17 : Motif.222

17 : Motif.222

3.18 18 : Motif.22

18 : Motif.22

18 : Motif.22

3.19 19 : Motif.154

19 : Motif.154

19 : Motif.154

3.20 20 : Motif.14

20 : Motif.14

20 : Motif.14